<?php 
/**
 * eBay Label Printing Program Quick Sign Up Form Class 
 * This is a Form Class , it provide the quick sign up Form 
 * @package  eBayLabelPrinter
 * @category Forms
 * @author   Norman Dong <norman.dong@hotmail.com>
 * @version  Initial
 * @copyright LeadCasket.com
 * @link     www.leadcasket.com
 * @license  Commercial
 * @todo   At the moment , this is NO validuator at all , I assue all input is correct
 */
class Model_Handlers_Loginhandler
{
	public function tryLogin($idSeller,$hashPassword){
	
		$seller = new Model_DbTable_Seller();
		$authAdapter = new Zend_Auth_Adapter_DbTable($seller->getAdapter(),'seller');
			
		$authAdapter->setIdentityColumn('id_seller')
		->setCredentialColumn('password_seller');
		$authAdapter->setIdentity($idSeller)
		->setCredential($hashPassword);
	
		$auth = Zend_Auth::getInstance ();
		$authResult = $auth->authenticate($authAdapter);
			
		if($authResult->isValid()){
			$authStorage = new Zend_Auth_Storage_Session();
			$authAdapter->write($authAdapter->getResultRowObject());
		}
		else{
			return false;
		}
		return true;
	
	}	
}

?>